import request from '@/axios'
import Cookies from 'js-cookie'
// 用户详情接口
export const userDetail = () => {
  const params = {
    token: Cookies.get('user_token')
  }
  return request.get({ url: '/user/info', params })
}
// 登录接口
export const login = (data: any) => {
  return request.post({ url: '/user/login', data })
}
// 用户注册接口
export const addUser = (data: any) => {
  return request.post({ url: '/user/create', data })
}
// 退出登录
export const logout = (data: any) => {
  data.token = Cookies.get('user_token')
  return request.post({ url: '/user/logout', data })
}
